/**********************************************
*  Namespace: AI
*  Classes:   SteeringWander
*  Desc:      Updates positions using a Wander
*             algorithm in 2d or 3d cases
*  Author:    Vaios Kalpias-Ilias (C) 2008-2009
***********************************************/

#include "SteeringWander.h"
#include "Helper.h"

namespace AI
{
	//---------------------------------------------
	/**
	* Ctor
	*/
	SteeringWander::SteeringWander()
	{
	}
	//---------------------------------------------
	/**
	* Dtor
	*/
	SteeringWander::~SteeringWander()
	{
	}
	//---------------------------------------------
	/**
	* Returns new kinematic data in 2d
	*/
	Steering2d SteeringWander::GetSteering(const Kinematic2d& current)
	{
		Steering2d steering;
		// get velocity from vector form of orientation
		steering.linear = maxAcceleration * mth::Helper::AsVector(current.orientation);
		
		// change orientation randomly
		steering.angular = maxAngularAcceleration * mth::Helper::RandomBinomial();

		return steering;
	}

}
